export const getDate = (time?: Date) => {
  let _time = time ? new Date(time) : new Date();
  const Year = _time.getFullYear();
  const Month = _time.getMonth() + 1;
  const Day = _time.getDate();
  return `${Year}-${Month}-${Day}`;
};


export const formatTime = (time: number) => {
  const _time = new Date(time);
  const Year = _time.getFullYear();
  const Month = _time.getMonth() + 1;
  const Day = _time.getDate();
  const Hours = _time.getHours();
  const Minutes = _time.getMinutes();
  const Seconds = _time.getSeconds();
  return `${Year}-${Month}-${Day} ${Hours}:${Minutes}:${Seconds}`;
};